/***************************************************************************
 *   Copyleft 2008-2009 by												   *
 *	 Iwanicki Krzysztof													   *
 *   <gamma.mini.pw.edu.pl/~iwanickik>									   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 ***************************************************************************/
#include "./vTextureUnit.h"

namespace Vendetta {
	vTextureUnit::vTextureUnit() {
		mpTexture = vNull;
		mBlendingOn = false;
		mSrcBlendMode = vTextureUnit::VBM_ONE;
		mDstBlendMode = vTextureUnit::VBM_ZERO;
		
		mUAddressMode = vTextureUnit::VAM_REPEAT;
		mVAddressMode = vTextureUnit::VAM_REPEAT;
		mWAddressMode = vTextureUnit::VAM_REPEAT;
		mMinMagFilterMode = vTextureUnit::VFM_NONE;

		mXScale = 1.0;
		mYScale = 1.0;
		mRotateAngle = 0.0;
	}

	vTextureUnit::~vTextureUnit() {

	}

	vTextureUnit::vTextureUnit(const vTextureUnit& texUnit) {
	}

	vTextureUnit& vTextureUnit::operator=(const vTextureUnit& texUnit) {
		return *this;
	}

	vVoid vTextureUnit::Apply() {
	}

	vVoid vTextureUnit::SetSrcBlendMode(eBlendMode blendMode) {
		mSrcBlendMode = blendMode;
	}

	vVoid vTextureUnit::SetDstBlendMode(eBlendMode blendMode) {
		mDstBlendMode = blendMode;
	}

	vVoid vTextureUnit::SetBlending(vBool bEnabled) {
		mBlendingOn = bEnabled;
	}

	vVoid vTextureUnit::SetUAddressMode(eAddressMode addressMode) {
		mUAddressMode = addressMode;
	}

	vVoid vTextureUnit::SetVAddressMode(eAddressMode addressMode) {
		mVAddressMode = addressMode;
	}

	vVoid vTextureUnit::SetWAddressMode(eAddressMode addressMode) {
		mWAddressMode = addressMode;
	}

	vVoid vTextureUnit::SetUVWAddressMode(eAddressMode addressMode) {
		mUAddressMode = addressMode;
		mVAddressMode = addressMode;
		mWAddressMode = addressMode;
	}

	vVoid vTextureUnit::SetMinMagFilterMode(eFilterMode filterMode) {
		mMinMagFilterMode = filterMode;
	}

	vVoid vTextureUnit::SetRotate(vReal rAngle) {
		mRotateAngle = rAngle;
	}

	vVoid vTextureUnit::SetXScale(vReal rScaleFactor) {
		mXScale = rScaleFactor >= 0.0 ? rScaleFactor : 0.0;
	}

	vVoid vTextureUnit::SetYScale(vReal rScaleFactor) {
		mYScale = rScaleFactor >= 0.0 ? rScaleFactor : 0.0;
	}

	vVoid vTextureUnit::SetXYScale(vReal rScaleFactor) {
		mXScale = rScaleFactor >= 0.0 ? rScaleFactor : 0.0;
		mYScale = mXScale;
	}

	vVoid vTextureUnit::AttachTexture(vTexture* texture) {
		mpTexture = texture;
	}
}